<template>
  <XtxBread>
    <XtxBreadItem to="/">首页</XtxBreadItem>
    <XtxBreadItem :to="`/category/${subFilter.parentId}`">{{ subFilter.parentName }}</XtxBreadItem>
    <XtxBreadItem>{{ subFilter.name }}</XtxBreadItem>
  </XtxBread>
</template>

<script>
import { inject } from 'vue'
export default {
  name: 'SubBread',
  setup () {
    // 获取父组件上提供的数据
    const subFilter = inject('subFilter')
    return { subFilter }
  }
}
</script>
